package models

import "github.com/astaxie/beego/orm"

type ForumThread struct {
	Id         int    `orm:"column(tid);pk"`
	Fid        int    `json:"fid"`
	Author     string `json:"author"`
	Authorid   int    `json:"authorid"`
	Subject    string `json:"subject"`
	Dateline   int64  `json:"dateline"`
	Lastpost   int64  `json:"lastpost"`
	Lastposter string `json:"lastposter"`
}

func (m *ForumThread) TableName() string {
	return TableName("pre_forum_thread")
}

func AddForumThread(m *ForumThread) (id int64, err error) {
	o := orm.NewOrm()
	id, err = o.Insert(m)
	return
}
